<?php
use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use app\modules\core\widgets\SlideNav;
?>
<div class="container-fluid">
	<div class="row">
        <?= SlideNav::widget() ?>
		<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 col-lg-10 col-lg-offset-2 main">
            <?= Breadcrumbs::widget([
                'homeLink' => ['label' => 'HOME', 'url' => '/core'],
                'links' => [
                    ['label' => '验证器', 'url' => '/core/validator/list'],
                    '查看',
                ]
            ]) ?>

                <div class="row">
                    <div class="col-md-12 col-lg-12">
                        <div class="alert alert-warning" role="alert">
                            <button type="button" class="close" data-dismiss="alert">×</button>
                            <strong>警告!</strong> 请注意你的个人隐私安全.
                        </div>

                        <div class="row">
                            <strong><label class="text-right col-sm-1">ID</label></strong>
                            <div class="col-sm-11"><?= $validator->id ?></div>
                        </div>
                        <div class="row">
                            <strong><label class="text-right col-sm-1">名称</label></strong>
                            <div class="col-sm-11"><?= $validator->name ?></div>
                        </div>
                        <div class="row">
                            <strong><label class="text-right col-sm-1">描述</label></strong>
                            <div class="col-sm-11"><?= $validator->desc ?></div>
                        </div>
                        <div class="row">
                            <strong><label class="text-right col-sm-1">是否内建</label></strong>
                            <div class="col-sm-11"><?= $validator->isBuiltIn ? "内建" : "自定义" ?></div>
                        </div>
                        <div class="row">
                            <strong><label class="text-right col-sm-1">命名空间</label></strong>
                            <div class="col-sm-11"><?= $validator->ns ?></div>
                        </div>
                        <div class="row">
                            <strong><label class="text-right col-sm-1">参数</label></strong>
                            <div class="col-sm-11"><?= $validator->params ?></div>
                        </div>
                        <div class="row">
                            <strong><label class="text-right col-sm-1">是否禁用</label></strong>
                            <div class="col-sm-11"><?= $validator->enable ? "可用" : "禁用" ?></div>
                        </div>
                        <div class="row">
                            <?php if (intval($validator->enable)) { ?>
                                <form action="/core/validator/disable" method="POST">
                                <input type="hidden" name="id" value="<?= $validator->id ?>" />
                                <button class="btn btn-primary">禁用</button>
                            <?php } else { ?>
                                <form action="/core/validator/enable" method="POST">
                                <input type="hidden" name="id" value="<?= $validator->id ?>" />
                                <button class="btn btn-primary">启用</button>
                            <?php } ?>
                                </form>
                        </div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
